
varying vec3  Normal;
varying vec3  EyeDir;
varying float LightIntensity;

uniform vec3  lpos;

void main() 
{
    gl_Position    = ftransform();
    Normal         = normalize(gl_NormalMatrix * gl_Normal);
    vec4 pos       = gl_ModelViewMatrix * gl_Vertex;
    EyeDir         = pos.xyz;
    LightIntensity = max(dot(normalize(lpos - EyeDir), Normal), 0.0);
}